<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="css/mui.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="css/style.css">
		<link rel="stylesheet" type="text/css" href="css/takeaway.css"/>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav header-bar">
			<!-- <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a> -->
			<h1 class="mui-title"> <span class="mui-icon mui-icon-location"></span> 青浦区洪悦华庭 <span class="mui-icon mui-icon-arrowdown"></span></h1>
		</header>
		
		<div class="mui-content">
			<div class="wm-serch">
				<div class="mui-input-row mui-search">
					<!-- <input type="search" class="mui-input-clear" placeholder=""> -->
					<input type="text" placeholder="请输入商家或商品名称" />
					<span class="mui-icon mui-icon-search" readonly="readonly"></span>
				</div>
			</div>
			<div class="content-box">
				<div class="wm-banner">
					<div class="mui-slider">
						<div class="mui-slider-group mui-slider-loop">
							<!--支持循环 需要重复图片节点-->
							<div class="mui-slider-item mui-slider-item-duplicate"><a href="#"><img src="images/banner4.png"> </a></div>
							<div class="mui-slider-item"><a href="#"><img src="images/banner1.png"/></a></div>
							<div class="mui-slider-item"><a href="#"><img src="images/banner2.png"/></a></div>
							<div class="mui-slider-item"><a href="#"><img src="images/banner3.png"/></a></div>
							<div class="mui-slider-item"><a href="#"><img src="images/banner4.png"/></a></div>
							<div class="mui-slider-item mui-slider-item-duplicate"><a href="#"><img src="images/banner1.png"/></a></div>
						</div>
						<!-- 轮播图中间底部原点 -->
						<div class="mui-slider-indicator">
							<div class="mui-indicator mui-active"></div>
							<div class="mui-indicator"></div>
							<div class="mui-indicator"></div>
							<div class="mui-indicator"></div>
						</div>
					</div>
				</div>			
				<div class="wm-menu">
					<div class="wm-menu-div">
						<span class="mui-icon mui-icon-email c-1"></span>
						<p >美食</p>
					</div>
					<div class="wm-menu-div">
						<span class="mui-icon mui-icon-email c-2"></span>
						<p>品牌馆</p>
					</div>
					<div class="wm-menu-div">
						<span class="mui-icon mui-icon-email c-3"></span>
						<p >预定早餐</p>
					</div>
					<div class="wm-menu-div">
						<span class="mui-icon mui-icon-email c-4"></span>
						<p >饿了么配送</p>
					</div>
					<div class="wm-menu-div">
						<span class="mui-icon mui-icon-email c-5"></span>
						<p >超级便利店</p>
					</div>
					<div class="wm-menu-div">
						<span class="mui-icon mui-icon-email c-6"></span>
						<p >甜品饮品</p>
					</div>
					<div class="wm-menu-div">
						<span class="mui-icon mui-icon-email c-7"></span>
						<p >果蔬生鲜</p>
					</div>
					<div class="wm-menu-div">
						<span class="mui-icon mui-icon-email c-8"></span>
						<p >鲜花蛋糕</p>
					</div>
				</div>
				
				<div class="wm-tj">
					<div class="wm-tj-l">
						<h4>热卖美食</h4>
						<p>附近最火美食</p>
						<img src="images/1-1.png" >
					</div>
					<div class="wm-tj-r">
						<div class="wm-tj-r-t">
							<div class="wm-tj-r-t-l">
								<h4>新店特惠</h4>
								<p>尝尝新口味</p>
								
							</div>
							<div class="wm-tj-r-t-r">
								<img src="images/1-4.png" >
							</div>
						</div>
						<div class="wm-tj-r-b">
							<div class="wm-tj-r-b-l">
								<h5>小吃零食</h5>
								<p>美味小吃</p>
								<img src="images/1-2.png" >
							</div>
							<div class="wm-tj-r-b-r">
								<h5>超时免单</h5>
								<p>预定午餐</p>
								<img src="images/1-3.png" >
							</div>
						</div>
					</div>
				</div>
			
				<div class="wm-list" id="div_list">
					<!-- <div class="wm-list-div">
						<div class="wm-list-div-l">
							<img src="images/logo.png" >
						</div>
						<div class="wm-list-div-r">
							<div class="wm-list-div-r-o">
								<div class="wm-list-div-r-o-l">
									<h4>韩国炸鸡专营店</h4>
								</div>
								<div class="wm-list-div-r-o-r">
									<h5> <span>¥</span><span class="big-txt">35</span>元起送</h5>
								</div>
							</div>
							<div class="wm-list-div-r-t">
								<div class="wm-list-div-r-t-l">
									<span class="mui-icon mui-icon-star-filled start-ys start-active"></span>
									<span class="mui-icon mui-icon-star-filled start-ys start-active"></span>
									<span class="mui-icon mui-icon-star-filled start-ys start-active"></span>
									<span class="mui-icon mui-icon-star-filled start-ys start-active"></span>
									<span class="mui-icon mui-icon-star-filled start-ys"></span>
									<span class="small-txt o-txt">4.5</span>
									<span class="small-txt">月售3522件</span>
								</div>
								<div class="wm-list-div-r-t-r">
									<span class="small-txt">免配送费</span>
								</div>
							</div>
							<div class="wm-list-div-r-tt">
								<span  class="small-txt">34分钟</span> <span  class="small-txt">1.5千米</span>
							</div>
						</div>
					</div> -->
					
				</div>
			</div>
		</div>
		
		
		<script src="js/castapp.js" type="text/javascript"></script>
		<script src="js/mui.js"></script>
		<script src="js/my_tmpl.js"></script>
		<script type="text/javascript">
			// mui.init()
			ca.init(false);
			castapp.pictureScroll({
				callback:function(pictureNumber){
					// console.log(pictureNumber)
				},
				isAutoScroll:true,
				scrollTime:3
			});
			
			var request_url = localStorage.getItem("request_url")
			var login_phone = localStorage.getItem("login_phone")
			
			var div_list = ca.id('div_list')
			
			ca.get({
				url:request_url + "Item/get_item",
				data:{},
				succFn:function(data){
					// alert(data)
					if (data) {
						var json = JSON.parse(data)
						div_list.innerHTML = ""
						for (var a in json) {
							var tmpl = my_tmpl.itemTmpl(json[a]);
							div_list.innerHTML += tmpl			
						}
						click_event()
					}
				}
			})
			
			
			function click_event(){
				var cell = ca.className("wm-list-div");
				for (var a = 0; a < cell.length ;a++) {
					
					cell[a].addEventListener('tap',function(){
						
// 						ca.newInterface({
// 							url:"shop.html",
// 							id:"shop"
// 						})

						var item_id = this.getAttribute('id_data')
						
						localStorage.setItem('item_id',item_id)
						
						ca.newInterface({
							url:"detail.html",
							id:"detail"
						})
					})
				}
			}
			
			
			//点击分类
			var class_btn = ca.className('wm-menu-div')
			for (var a = 0; a < class_btn.length;a++){
				class_btn[a].addEventListener('tap',function(){
					var p = this.getElementsByTagName('p');
					var title = p['0'].innerHTML
					
					localStorage.setItem('class_title',title)
					
					ca.newInterface({
						url:'class_item.html',
						id:'class_item'
					})
				})
			}
			
		</script>
	</body>

</html>
